<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>预算询价详情</title>
<link href="/res/css/respective/priceAsk/buyer.css" rel="stylesheet">
</head>
<body>
[#assign  menucode ="myProject"]
	<div class="warp">
		[#include "/front/common/front_headAzt.html"]
		<div class="backcontent">
			[#include "/front/common/front_leftAzt.html"]
			<div class="back-main">
				<div class="mainContent">
		<div class="mainContentWhite">
			<h1>预算询价报价详情</h1>
			<label class="opDetail" style="text-align: right; float: right;"><a href="/enquiry/project/detail/p/${enq.projectId}/t/1">返回项目</a></label>
			<hr>
			<h2>基本信息</h2>
			<div class="baseInfo">
								<div>
									<dfn>
										询价名称：<span class="ellipsis">${enq.enquiryName!} </span>
									</dfn>
									<dfn>
										发布公司：<span>${enq.companyName!}</span>
									</dfn>
								</div>
								<div>
									<dfn>
										项目名称：<span>${enq.enqProject.projectName!}</span>
									</dfn>
								</div>
								<div>
									<dfn>
										客户名称：<span>${(enq.enqProject.customerName)!}</span>
									</dfn>
									<dfn>
										项目所在地：<span>${(enq.enqProject.getAddressName("-"))!}</span>
									</dfn>
								</div>
								<div>
									<dfn>
										是否含税：<span>[#if enq.taxPrice==3 ]不含[#else]含税[/#if] </span>
									</dfn>
									<dfn>
										是否含运费：<span>${(enq.shipPrice==1)?string("含运费","不含运费")}  </span>
									</dfn>
								</div>
								<div>
									<dfn>
										质保要求：<span>[#if enq.quality?? ]${enq.quality}年[#else]${enq.guaranteeinfo!} [/#if]</span>
									</dfn>
									<dfn>
                                        项目资料：[#if enq.attachfile?? ] <a href="${enq.attachfile!}" >附件下载</a>[/#if]
									</dfn>
								</div>
			</div> 
			<hr style="margin-bottom: 15px;"> 
			<div class="othNed">
				<label style="color: #999999">其他要求：</label>
				  ${enq.otherRemarks!}
			</div> 
			
			<h2>供应商报价
				<small class="itermTip">
				<em style="vertical-align: middle;">产品类目：</em>
					<div class="ppSelect" style="display: inline-block;background: url(/res/images/checkBoxRadio/blueSelect_03.jpg) right center no-repeat;height: 20px;">
                                        <select id="allcats"  style="height: 100%; border: none;background: none;">
                                            <option value="0">所有目录</option>
                                        [#list encats as cat ]
                                            <option value="${cat.categoryId}">${cat.categorName}</option>
                                        [/#list]
                                        </select>
                                    </div>
				</small> 
			</h2>
			<table class="table noBorder">
				  <thead>
                            <tr>
                                <th style="width: 10%;"><input style="height: auto;" id="checkall"  type="checkbox"/><em style="vertical-align: middle;margin-left: 5px;">全选</em></th>
                                <th style="width: 20%;">供应商</th>
                                <th style="width: 10%;">报价数量 </th>
                                <th style="width: 15%;">清单报价 </th>
                                <th style="width: 10%;">税率</th>
                                <th style="width: 25%;">报价系统</th>
                            [#--<th>购买状态</th>--]
                                <th style="width: 10%;">操作</th>
                            </tr>
                            </thead>
                            <tbody>

                            [#list quotes as quote ]
                            <tr attrids ="${quote.categoryIds!}" class="q_tr"  >
                                <td><input class="quotec" style="height: auto;" type="checkbox"  value="${quote.quoteId}" /></td>
                                <td>[#--<a class="bugetTypeIcon">集</a>--]${quote.companyName}</td>
                                <td>${quote.quantity}</td>
                                <td class="contentBold">${quote.totalprice!0}</td>
                                <td>${quote.taxInstro}%</td>
                                <td style="text-align: left;">${quote.categroyNames!}</td>
                            [#--<td>Otto</td>--]
                                <td><a href="/enquiry/design/quote/detail/item/${quote.quoteId}" >报价清单</a></td>
                            </tr>

                            [/#list]


                            </tbody> 
			</table>
			 
			<div style="margin-top: 30px;height: 45px;">
                [#if user.id == enq.userId ]
				 <button class="backButt" onclick="downquote()"  type="button">下载报价清单</button>
                [/#if]
                    [#--2016/12/29  胡子强, 张栋  自己发的自己转 --]
                 [#if user.id == enq.userId && enq.state==1  ]
                 <button class="backButt" onclick="createDesignBudget()"   type="button"  style="float: right;width: 170px;">制作预算成本清单</button>
                [/#if]
			</div>
		</div>
	</div>
			</div>
			<!-- 底部菜单-->
			[#include "/front/common/front_footerAzt.html"]
		</div>
 
	</div>
<script src="/res/js/common/jquery.1.9.1.min.js"></script>
<script src="/res/js/buyer/buyer.js"></script>
<script src="/res/js/common/common.js"></script>
<script src="/res/third/layer/layer.js"></script>
<script src="/res/third/layer/layer.extends.js"></script>
<script src="/res/js/common/jquery.ellipsis.js"></script>
<script type="text/javascript">
$(function(){
	$(".ellipsis").ellipsis({maxWidth:290,maxLine:1});
});
    $("#allcats").on("change",function () {
        console.log("change");
        var trobj = $(this);
        var v= trobj.val();
        console.log(v);
        //筛选
        $(".q_tr").each(function () {
            if(v==0){
                trobj.show();
                return true;
            }

            var idstr = $(this).attr("attrids");
            var ids = idstr.split(",");
            if($.inArray(v,ids)==-1){
                trobj.hide();
            }else{
                trobj.show();
            }
        })
    })


    function downquote() {
        var ids =[];
        $(".quotec:checked").each(function () {
            ids.push($(this).val());
        });
        if(ids.length==0){
            layer.msgShort("至少选择一个公司!")
        }else{
            location.href="/enquiry/quote/download/"+ids.join(",");
        }
    }

    function createDesignBudget() {
        var ids =[];
        $(".quotec:checked").each(function () {
            ids.push($(this).val());
        });
        if(ids.length==0 ){
            layer.msgShort("至少选择一家公司!")
        }else{
            location.href="/enquiry/budget/design/create/${enq.id}/"+ids.join(",");;
        }
    }



    $("#checkall").click(function () {
        var obj = $(this);
        $(".quotec").each(function () {
            $(this)[0].checked=obj.is(":checked");
        })
    });

</script>
</body>
</html>
